package com.yfqy.admin.domain.mapper;

import com.yfqy.admin.domain.dto.auth.AuthRole;
import com.yfqy.admin.domain.dto.system.RolesWithUser;
import com.yfqy.admin.domain.dto.system.SysRoleDetail;
import com.yfqy.admin.domain.entity.SysRole;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysRoleMapper {
    int deleteByPrimaryKey(Long id);

    int insert(SysRole record);

    int insertSelective(SysRole record);

    SysRole selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysRole record);

    int updateByPrimaryKey(SysRole record);

    List<AuthRole> selectRolesByUserId(@Param("userId") Long userId);

    List<SysRoleDetail> selectUserRoles(@Param("userId") Long id);

    SysRole selectOneByRoleName(@Param("roleName") String roleName);

    SysRole selectOneByRoleCode(@Param("code") String code);

    List<SysRoleDetail> selectPageByRoleNameAndStatus(@Param("roleName") String roleName, @Param("status") Byte status);

    List<SysRole> selectByIds(@Param("roleIds") List<Long> roleIds);

    List<RolesWithUser> selectAllValid();

}